<template>
  <div class="login-page">
    <main>
      <!-- 科技感背景元素 -->
      <div class="grid-background" />
      <div class="glow-circle glow-circle-1" />
      <div class="glow-circle glow-circle-2" />
      <div class="tech-line tech-line-1" />
      <div class="tech-line tech-line-2" />
      <div class="wave" />
      <div class="wave wave-2" />

      <!-- 主内容容器 -->
      <div class="main-content">
        <!-- 平台标题 -->
        <div class="platform-title">
          <h2>智能空调集中控制管理平台</h2>
        </div>

        <!-- 登录卡片 -->
        <div class="login-card">
          <div class="login-title">
            <h1>欢迎登录</h1>
          </div>

          <!-- 登录表单 -->
          <el-form
            id="loginForm"
            ref="loginForm"
            class="login-form"
            :model="loginForm"
            :rules="rules"
          >
            <!-- 用户名输入 -->
            <div class="form-group">
              <el-form-item prop="username">
                <label for="username">用户名</label>
                <div class="input-wrapper form-input">
                  <svg-icon icon-class="loginUser" style="fill: #00ffff" />
                  <el-input
                    v-model="loginForm.username"
                    type="text"
                    placeholder="请输入用户名"
                  />
                </div>
              </el-form-item>
            </div>

            <!-- 密码输入 -->
            <div class="form-group">
              <el-form-item prop="password">
                <label for="password">密码</label>
                <div class="input-wrapper form-input">
                  <svg-icon icon-class="loginPass" style="fill: #00ffff" />
                  <el-input
                    v-model="loginForm.password"
                    :type="passwordType"
                    placeholder="请输入密码"
                  />
                  <button
                    id="togglePassword"
                    type="button"
                    class="toggle-password"
                    @click="togglePasswordVisibility"
                  >
                    <svg-icon
                      v-if="!showPassword"
                      icon-class="loginNoSee"
                      style="fill: #00ffff"
                    />
                    <svg-icon
                      v-else
                      icon-class="loginSee"
                      style="fill: #00ffff"
                    />
                  </button>
                </div>
              </el-form-item>
              <!-- <div class="password-options">
                <div class="remember-me">
                  <input
                    type="checkbox"
                    id="rememberMe"
                    name="rememberMe"
                    v-model="loginForm.rememberMe">
                  <label for="rememberMe">记住密码</label>
                </div>
                <a href="#" id="forgotPassword" class="forgot-password" @click.prevent="handleForgotPassword">
                  忘记密码？
                </a>
              </div> -->
            </div>
            <!-- 验证码输入 -->
            <div class="form-group">
              <el-form-item prop="checkForm">
                <label for="checkForm">验证码</label>
                <div style="display: flex">
                  <div class="input-wrapper form-input">
                    <svg-icon icon-class="loginPass" style="fill: #00ffff" />
                    <el-input
                      v-model="loginForm.checkForm"
                      type="text"
                      class=""
                      placeholder="验证码"
                      @change="submitForm('loginForm')"
                    />
                  </div>
                  <img
                    class="check-img"
                    :src="codeImg"
                    alt=""
                    @click="getCode"
                  />
                </div>
              </el-form-item>
            </div>
            <!-- 登录按钮 -->
            <el-form-item>
              <el-button
                class="login-button"
                :loading="loading"
                @click="submitForm('loginForm')"
                >登录
                <i
                  class="el-icon-right"
                  style="color: black; font-weight: 700; font-size: 18px"
                />
              </el-button>
            </el-form-item>
            <!-- 直接进入首页按钮（测试用） -->
            <!-- <div class="direct-to-home">
              <button type="button" id="directToHome" @click="goToHome">
                直接进入首页（测试用）
              </button>
            </div> -->
          </el-form>
        </div>

        <!-- 页脚信息 -->
        <div class="login-footer">
          <!-- <p>© 2023 空调集控平台 版权所有</p>
          <p>版本 1.0.0</p> -->
        </div>
      </div>
    </main>
  </div>
</template>

<script>
import { getCode } from "@/api/user";
export default {
  name: "LoginPage",
  data() {
    return {
      loginForm: {
        username: "",
        password: "",
        checkForm: "",
        rememberMe: false,
      },
      showPassword: false,
      loading: false,
      particleCount: 50, // 添加粒子计数
      rules: {
        username: [
          { required: true, message: "请输入用户名", trigger: "blur" },
        ],
        password: [{ required: true, message: "请输入密码", trigger: "blur" }],
        checkForm: [
          { required: true, message: "请输入验证码", trigger: "blur" },
        ],
      },
      codeImg: "",
      verifyKey: "",
    };
  },
  computed: {
    passwordType() {
      return this.showPassword ? "text" : "password";
    },
    passwordIcon() {
      return this.showPassword ? "fas fa-eye" : "fas fa-eye-slash";
    },
  },
  watch: {
    $route: {
      handler: function (route) {
        const query = route.query;
        if (query) {
          this.redirect = query.redirect;
          this.otherQuery = this.getOtherQuery(query);
        }
      },
      immediate: true,
    },
  },
  mounted() {
    this.getCode();
    // 创建科技感粒子
    this.$nextTick(() => {
      // 创建科技感粒子
      const main = document.querySelector("main");
      if (main) {
        for (let i = 0; i < this.particleCount; i++) {
          this.createParticle(main);
        }
      }
    });
  },
  methods: {
    getCode() {
      getCode().then((res) => {
        if (res.code === 0) {
          this.codeImg = this.coverBase64ToImage(res.img);
          this.verifyKey = res.verifyKey;
        }
      });
    },
    coverBase64ToImage(base64Data) {
      if (base64Data.startsWith("data:image")) {
        return base64Data;
      }
      if (base64Data) {
        return "data:image/png;base64," + base64Data;
      }
      return "";
    },

    createParticle(parent) {
      const particle = document.createElement("div");
      particle.classList.add("particle");
      // 随机大小
      const size = Math.random() * 2 + 0.5;
      particle.style.width = `${size}px`;
      particle.style.height = `${size}px`;
      // 随机位置
      particle.style.left = `${Math.random() * 100}%`;
      particle.style.top = `${Math.random() * 100}%`;

      // 随机动画延迟和持续时间
      const delay = Math.random() * 10;
      const duration = Math.random() * 20 + 10;
      // 关键修改：正确应用动画样式
      particle.style.animation = `float ${duration}s ease-in-out infinite`;
      particle.style.animationDelay = `${delay}s`;
      parent.appendChild(particle);
    },
    togglePasswordVisibility() {
      this.showPassword = !this.showPassword;
    },
    handleForgotPassword() {
      alert("忘记密码功能正在开发中...");
    },
    goToHome() {
      this.$router.push("/home"); // 需要配置路由
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.loading = true;
          this.doLogin();
        } else {
          console.log("error submit!!");
          return false;
        }
      });
      // this.$router.push('/home') // 需要配置路由
    },
    doLogin() {
      this.loginForm = { ...this.loginForm, verifyKey: this.verifyKey };
      this.$store
        .dispatch("user/login", this.loginForm)
        .then(() => {
          // 登录成功后立即获取菜单
          const userId =
            this.$store.getters.userId || // 修改为 this.$store
            (this.$store.state.user.userInfo // 修改为 this.$store
              ? this.$store.state.user.userInfo.userId
              : null);
          return this.$store.dispatch(
            "permission/generateRoutesFromAPI",
            userId
          );
        })
        .then((accessRoutes) => {
          // 将获取到的路由添加到路由器中
          this.$router.addRoutes(accessRoutes);
          this.loading = false;
          this.$nextTick(() => {
            let redirectPath = this.redirect || "/index";
            try {
              redirectPath = decodeURIComponent(redirectPath);
            } catch (e) {
              console.warn("URL解码失败:", e);
            }
            if (redirectPath && redirectPath.includes("?")) {
              redirectPath = redirectPath.split("?")[0];
            }
            try {
              this.$router.push({
                path: redirectPath,
                query: this.otherQuery,
              });
            } catch (error) {
              console.error("路由跳转错误:", error);
              this.$router.push("/index");
            }
          });
        })
        .catch(() => {
          this.loading = false;
          this.getCode();
        });
    },
    // doLogin() {
    //   this.loginForm = { ...this.loginForm, verifyKey: this.verifyKey };
    //   this.$store
    //     .dispatch("user/login", this.loginForm)
    //     .then(() => {
    //       this.loading = false;
    //       this.$nextTick(() => {
    //         // 先检查路由是否存在
    //         const redirectPath = this.redirect || "/index";

    //         // 使用 push 方法并正确处理 Promise
    //         try {
    //           this.$router.push({
    //             path: redirectPath,
    //             query: this.otherQuery,
    //           });
    //         } catch (error) {
    //           console.error("路由跳转错误:", error);
    //           // 如果跳转失败，强制跳转到首页
    //           this.$router.push("/index");
    //         }
    //       });
    //     })
    //     .catch(() => {
    //       this.loading = false;
    //       this.getCode();
    //     });
    // },
    getOtherQuery(query) {
      return Object.keys(query).reduce((acc, cur) => {
        if (cur !== "redirect") {
          acc[cur] = query[cur];
        }
        return acc;
      }, {});
    },
  },
};
</script>

<style scoped lang="scss">
/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.login-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f8fafc;
  height: 100vh;
  overflow: hidden;
}

/* 主背景样式 */
main {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0a0c16;
  overflow: hidden;
}

/* 科技感网格背景 */
.grid-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      rgba(16, 255, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(16, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: center;
  z-index: 0;
  perspective: 500px;
  transform-style: preserve-3d;
  animation: gridMove 60s linear infinite;
}

/* 发光圆形效果 */
.glow-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}

.glow-circle-1 {
  width: 400px;
  height: 400px;
  top: -150px;
  left: -100px;
  background: rgba(56, 189, 248, 0.3);
  animation: glowPulse 8s ease-in-out infinite;
}

.glow-circle-2 {
  width: 500px;
  height: 500px;
  bottom: -200px;
  right: -150px;
  background: rgba(124, 58, 237, 0.3);
  animation: glowPulse 10s ease-in-out infinite reverse;
}

/* 科技感线条 */
.tech-line {
  position: absolute;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(16, 255, 255, 0.5),
    transparent
  );
  height: 1px;
  z-index: 0;
}

.tech-line-1 {
  width: 100%;
  top: 30%;
  animation: lineSlide 15s linear infinite;
}

.tech-line-2 {
  width: 100%;
  top: 70%;
  animation: lineSlide 20s linear infinite reverse;
}

/* 动态波浪效果 */
.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 80px;
  background: linear-gradient(
    90deg,
    rgba(124, 58, 237, 0.1) 0%,
    rgba(56, 189, 248, 0.2) 50%,
    rgba(124, 58, 237, 0.1) 100%
  );
  z-index: 0;
  animation: waveMove 15s linear infinite;
}

.wave-2 {
  height: 60px;
  bottom: -20px;
  opacity: 0.7;
  animation-delay: -5s;
  animation-duration: 20s;
}

/* 动画效果 */
@keyframes gridMove {
  0% {
    transform: rotateX(60deg) translateY(0) translateZ(0);
  }
  100% {
    transform: rotateX(60deg) translateY(-500px) translateZ(0);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.4;
  }
}

@keyframes lineSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes waveMove {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

/* 登录卡片容器 */
.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: auto;
  margin-top: 20px;
  width: 100%;
  max-width: 420px;
  perspective: 1000px;
}

/* 登录卡片 - 增强科技感 */
.login-card {
  background: rgba(10, 12, 22, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(16, 255, 255, 0.1);
  transform: translateZ(0);
  transition: all 0.3s ease;
  border: 1px solid rgba(16, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  width: 100%;
  .svg-icon {
    font-size: 24px;
  }
}

/* 卡片科技感边框 */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(16, 255, 255, 0.5),
    transparent
  );
}

/* 卡片装饰线条 */
.login-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0.1),
    rgba(16, 255, 255, 0.5),
    rgba(124, 58, 237, 0.1)
  );
  transform: scaleX(0.5);
  transform-origin: center;
  transition: transform 0.3s ease;
}

/* 卡片悬浮发光效果 */
.login-card:hover {
  transform: translateY(-5px) translateZ(0);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(16, 255, 255, 0.1);
  border-color: rgba(16, 255, 255, 0.2);
}

.login-card:hover::after {
  transform: scaleX(1);
}

/* 标题样式 - 增强科技感 */
.login-title {
  text-align: center;
  margin-bottom: 15px;
  position: relative;
}

.login-title h1 {
  font-size: 2.25rem;
  font-weight: 700;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 8px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(16, 255, 255, 0.8) 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(16, 255, 255, 0.3);
}

.login-title p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.0625rem;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 表单样式 */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  img {
    width: 25px;
    height: 25px;
  }
}
.check-img {
  width: 150px;
  height: 48px;
  // border-radius: 12px;
  margin-left: 40px;
  cursor: pointer;
}
.input-icon {
  position: absolute;
  left: 12px;
  color: rgba(16, 255, 255, 0.5);
  transition: color 0.2s ease;
}

.form-input {
  width: 100%;
  padding: 5px 15px;
  border: 2px solid rgba(16, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
.form-input ::v-deep .el-input__inner {
  background-color: transparent;
  border: 0;
  color: #ffffff;
}
.form-group ::v-deep .el-form-item__error {
  color: #00ffff;
  padding-left: 10px;
}

.form-input:focus {
  outline: none;
  border-color: rgba(16, 255, 255, 0.7);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(16, 255, 255, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-input:focus + .input-icon {
  color: rgba(16, 255, 255, 1);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

// 针对 Element UI 的输入框
::v-deep .el-input__inner:-webkit-autofill,
::v-deep .el-input__inner:-webkit-autofill:hover,
::v-deep .el-input__inner:-webkit-autofill:focus,
::v-deep .el-input__inner:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px transparent inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
  background-color: transparent;
  transition: background-color 5000s ease-in-out 0s;
}
::v-deep .el-input__inner:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px transparent inset !important;
  -webkit-text-fill-color: #ffffff !important;
  background-color: transparent !important;
  border: none;
}

/* 密码可见性切换 */
.toggle-password {
  position: absolute;
  right: 12px;
  color: rgba(16, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: none;
}

.toggle-password:hover {
  color: rgba(16, 255, 255, 1);
}

/* 记住密码和忘记密码 - 增强科技感 */
.password-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  border: 2px solid rgba(16, 255, 255, 0.3);
  border-radius: 4px;
  accent-color: rgba(16, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.remember-me input[type="checkbox"]:hover {
  border-color: rgba(16, 255, 255, 0.5);
}

.remember-me label {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  user-select: none;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  transition: color 0.3s ease;
}

.remember-me label:hover {
  color: rgba(255, 255, 255, 0.9);
}

.forgot-password {
  font-size: 0.9375rem;
  color: rgba(16, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
}

.forgot-password:hover {
  color: rgba(16, 255, 255, 1);
}

.forgot-password::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(16, 255, 255, 0.7),
    transparent
  );
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.forgot-password:hover::after {
  transform: scaleX(1);
}

/* 登录按钮 - 增强科技感 */
.login-button {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(
    90deg,
    rgba(16, 255, 255, 0.95),
    rgba(56, 189, 248, 0.95)
  );
  color: #0a0c16;
  border: none;
  border-radius: 12px;
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  text-shadow: 0 0 5px rgba(10, 12, 22, 0.2);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  border: 1px solid rgba(16, 255, 255, 0.3);
}

.login-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.login-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(16, 255, 255, 0.5),
    0 0 0 1px rgba(16, 255, 255, 0.3);
  background: linear-gradient(
    90deg,
    rgba(16, 255, 255, 1),
    rgba(56, 189, 248, 1)
  );
}

.login-button:hover::before {
  left: 100%;
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(16, 255, 255, 0.5),
    0 0 0 1px rgba(16, 255, 255, 0.2);
}

/* 直接进入首页按钮 - 增强科技感 */
.direct-to-home {
  margin-top: 24px;
  text-align: center;
}

.direct-to-home button {
  background: none;
  border: none;
  color: rgba(16, 255, 255, 0.7);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
  padding: 4px 8px;
}

.direct-to-home button:hover {
  color: rgba(16, 255, 255, 1);
}

.direct-to-home button::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(16, 255, 255, 0.7),
    transparent
  );
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.direct-to-home button:hover::after {
  transform: scaleX(1);
}

/* 直接进入首页按钮 */
.direct-to-home {
  margin-top: 20px;
  text-align: center;
}

.direct-to-home button {
  background: none;
  border: none;
  color: rgba(16, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.direct-to-home button:hover {
  color: rgba(16, 255, 255, 1);
  text-decoration: underline;
}

/* 页脚信息 - 增强科技感 */
.login-footer {
  margin-top: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
}

.login-footer p {
  margin-bottom: 4px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card {
  animation: fadeIn 0.6s ease-out;
}

/* 主内容容器 */
.main-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  gap: 30px;
}

/* 平台标题样式 - 增强科技感 */
.platform-title {
  text-align: center;
  z-index: 2;
  margin-top: 20px;
  width: 100%;
}

.platform-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 2px;
  line-height: 1.2;
  margin: 0 0 20px 0;
  /* 增强的发光效果和渐变色 */
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(16, 255, 255, 1) 40%,
    rgba(56, 189, 248, 1) 60%,
    rgba(255, 255, 255, 0.9) 100%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* 更强的霓虹发光效果 */
  text-shadow: 0 0 8px rgba(16, 255, 255, 0.9), 0 0 20px rgba(16, 255, 255, 0.7),
    0 0 40px rgba(16, 255, 255, 0.5), 0 0 80px rgba(16, 255, 255, 0.3);
  /* 流畅的文字渐变动画 */
  animation: textShine 3s ease-in-out infinite;
}

/* 文字渐变动画 */
@keyframes textShine {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* 响应式设计 */
@media (max-width: 480px) {
  main {
    padding: 16px;
  }

  .login-card {
    padding: 24px;
    border-radius: 16px;
  }

  .login-title h1 {
    font-size: 1.75rem;
  }

  .platform-title h2 {
    font-size: 1.5rem;
    padding: 0 16px;
    letter-spacing: 1px;
  }
}
</style>
<style lang="scss">
/* 科技感粒子 */
.particle {
  position: absolute;
  background: rgba(16, 255, 255, 0.8);
  border-radius: 50%;
  z-index: 0;
}

/* 粒子浮动动画 */
@keyframes float {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateY(-200px);
  }
}
</style>
